package com.hbsi.demo1;

/**
 * @author 程奕红
 * @version 1.0
 */
public class MyThread2 implements Runnable {
    @java.lang.Override
    public void run() {
        //完成任务的方法写在run()方法中
        int i=0;
        while(i<=10){
            System.out.println("这是实现了Runable的线程");
            i++;
            try {
                Thread.sleep(1000);//让出cpu
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
    }
}
